<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <title>Document</title>
  <script>
    function imgLoad(){
        myimg = document.getElementById('myimg');
        //图片加载完成后，给图片加边框
        myimg.style.border='9px solid #00ff00';
        alert('图片加载完成，给它加边框');
    }
  </script>
 </head>
 <body>
  <img id='myimg' src="book.png" onload="imgLoad()">
 </body>
</html>
